package com.xiaoyu.izf.service;

import com.xiaoyu.izf.model.SysLog;
import com.xiaoyu.izf.repository.SysLogDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;

@Service
public class SysLogService {

    @Autowired
    private SysLogDao sysLogDao;

    public SysLog add(String logType,String content){
        SysLog log = new SysLog();
        log.setLogType(logType);
        log.setLogContent(content);
        log.setLogTime(new Timestamp(System.currentTimeMillis()));
        return sysLogDao.save(log);
    }

    public SysLog save(SysLog log){
        return sysLogDao.save(log);
    }
}
